package com.dankegongyu.customer;

import android.app.Application;
import android.content.Context;
import android.util.Log;

import com.dankegongyu.component.push.DKPush;
import com.dankegongyu.component.push.DKPushReceiveListener;
import com.igexin.sdk.message.GTCmdMessage;
import com.igexin.sdk.message.GTNotificationMessage;
import com.igexin.sdk.message.GTTransmitMessage;

/**
 * @author wupuquan
 * @version 1.0
 * @since 2018/7/23 13:08
 */
public class PushUtil {

    private PushUtil() {
    }

    public static void init (Application application) {
        DKPush.init(application, new PushReceiveListener());
    }

    private static class PushReceiveListener implements DKPushReceiveListener {

        private static final String TAG = "蛋壳App推送测试";

        @Override
        public void onReceiveServicePid(Context context, int pid) {
            Log.d(TAG, "onReceiveServicePid: " + pid);
        }

        @Override
        public void onReceiveMessageData(Context context, GTTransmitMessage msg) {
            Log.d(TAG, "onReceiveMessageData: " + new String(msg.getPayload()));
        }

        @Override
        public void onReceiveClientId(Context context, String clientId) {
            Log.d(TAG, "onReceiveClientId: " + clientId);
        }

        @Override
        public void onReceiveOnlineState(Context context, boolean online) {
            Log.d(TAG, "onReceiveOnlineState: ");
        }

        @Override
        public void onReceiveCommandResult(Context context, GTCmdMessage cmdMessage) {
            Log.d(TAG, "onReceiveCommandResult: ");
        }

        @Override
        public void onNotificationMessageArrived(Context context, GTNotificationMessage msg) {
            Log.d(TAG, "onNotificationMessageArrived: ");
        }

        @Override
        public void onNotificationMessageClicked(Context context, GTNotificationMessage msg) {
            Log.d(TAG, "onNotificationMessageClicked: ");
        }
    }
}
